1. Field of the Invention
The present invention relates in general to a method for increasing the execution speed of discrete event simulations. More specifically, the present invention relates to a method for executing at least one discrete event simulation model in high speed by integrating a just-in-time compiler embedded into the discrete event simulation model to allow the dynamic execution of high speed code blocks associated with one or more events within the simulation.
2. Background
Discrete event simulations are a common method of modeling real-world processes having a number of different activities and involving one or a number of resources. Discrete event simulations create a mathematical model of a system and use a series of state variables to track the evolution of that system over time. The advantage of such discrete event simulations is that they provide a method to test scenarios in a computer environment before implementing changes in a real-world setting.
Discrete event simulations face a number of challenges to ensure the execution of large or complex simulations in a timely manner. One of the most significant challenges is the need to incorporate any number of user-specific conditions and state changes into the simulation. These user-specific conditions can have any form and are often quite complex. Current simulation frameworks typically allow a subset of these conditions and changes to be made using a graphical user interface (GUI). However, no matter how general or complex the GUI, there are inevitably shortcomings with the simulation frameworks and the user is sometimes faced with the need to add customized ‘code’ or logic to the simulation. An example is the need to differentiate a complex function (say, integrating a function numerically at a particular point) in order to determine whether an event in the simulation should be scheduled. GUIs do not typically incorporate such functions, since such complex mathematics would only be present in a comprehensive math modeling language. This means that simulations generated using a GUI alone is not representative of the system being modeled.
In order to allow for such logic, discrete event simulation languages sometimes incorporate user-specific ‘code’ programmed in an existing programming language (Visual Basic, Java etc) that may incorporate the execution of a simulation within the scope of such code. They sometimes also embed the simulation within the scope of some other custom code that can perform calculations outside the scope of the simulation. For example, U.S. Pat. No. 7,624,383 issued to Barr on Nov. 24, 2009 provides a system and method that allows the embedding of simulation primitives within a conventional programming language in order to use the full capabilities of the conventional programming language and its compiler without modification in the programming of efficient, scalable simulators. However, this method does not possess the ability to embed custom source code inside a simulation program—only to embed a simulation inside custom source code. It does not, for example, allow differentiation to be part of the simulation execution. Moreover, it does not have to ‘just-in-time’ compile and link the custom functions to the execution of the simulation.
U.S. Pat. No. 5,828,867 issued to Pennell on Oct. 27, 1998 describes a method for re-configuring a pre-compiled discrete-event digital simulation program. The method comprises steps for creating a template having a series of generic tasks and incorporating the template onto a computer to create a generic computer simulation. Even so, the method cannot include all of the possible kinds of events and logics in a real-world simulation. Further, once the template is defined for a particular industry or problem, it cannot be customized without a complex process to re-establish a new template. This approach therefore suffers from the same problems described with GUIs.
U.S. Pat. No. 5,701,439 issued to James on Oct. 23, 1997 provides a combined discrete-event and continuous model simulation and analysis tool. The objective in developing this simulation tool is to provide a uniform simulation platform appropriate for all combinations of simulation model requirements, language implementations, and host processor types. However, this approach does not incorporate any number of user-specific conditions and state changes, as described in the limitations above. Furthermore, this approach uses manual compilation steps, rather than ‘just-in-time’ compilation that results in a slow simulation execution speed. Finally, the approach only allows a limited architecture for simulation models to communicate with each other.
Similarly, in some other methods, the low execution speed of user-specific ‘code’ is due to the different language of that code from the simulation program causing the code to be interpreted rather than pre-compiled. Since the interpreted languages are not directly executed by the central processing unit (CPU) but by an interpreter, such methods result in a much slower speed of simulation program execution compared to direct machine code execution on the host CPU.
Hence, it can be seen, that there is a need for a method that would use an effective compilation technique that allows user-entered logic to be executed in high speed and be completely customizable such that any condition or logic can be entered within the scope of the events in the simulation. Further, the needed method would include the ability to incorporate any number of user-specific conditions and state changes. Moreover, the method would include all of the possible types of events and logic in a real-world simulation.